import {
  IsString,
  IsOptional,
  Length,
  IsNumber,
  Min,
  Max,
} from 'class-validator';

export class CreateUserDto {
  @IsOptional()
  @IsString()
  @Length(0, 255)
  avatar?: string;

  @IsString()
  @Length(3, 50)
  username: string;

  @IsString()
  @Length(6, 255)
  password: string;

  @IsOptional()
  @IsString()
  @Length(0, 50)
  roles?: string;

  @IsOptional()
  @IsString()
  @Length(0, 100)
  nickname?: string;

  @IsOptional()
  @IsNumber()
  @Min(0)
  @Max(1)
  active?: number;
}
